// 抽象基类
import { PlatformStrategy } from './PlatformStrategy';

export abstract class AbstractPlatform implements PlatformStrategy {
  abstract exchangeToken(code: string): Promise<{ access_token: string; expires_in: number }>;
  abstract revokeToken(access_token: string): Promise<void>;
  abstract  refreshToken(userId: string, oldToken: string): Promise<{ access_token: string; expires_in: number }>;
  abstract  getDeviceList(accessToken: string): Promise<{
    did: string;
    name: string;
    type: string;
    online: boolean;
  }[]>;
  abstract subscribeDevice(accessToken: string, deviceId: string): Promise<void>;
  abstract revokeDeviceSubscription(userId: string, did: string):Promise<void>;



  protected logExchange(platform: string, isMock: boolean) {
    console.log(`[${platform}] Using ${isMock ? 'Mock' : 'Real'} Strategy`);
  }
}
